package com.example;

import com.example.service.OrderService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        OrderService orderService = context.getBean("orderService", OrderService.class);

        System.out.println("=== 测试add方法 ===");
        orderService.add("手机", 2);

        System.out.println("\n=== 测试delete方法 ===");
        orderService.delete("手机");

        System.out.println("\n=== 测试find方法 ===");
        int count = orderService.find("手机");
        System.out.println("查询结果: " + count);
    }
}